package com.qianyu.project.mapper.provider.base;

import org.apache.ibatis.jdbc.SQL;
/**
 * @author gs
 * @date create in 2020/12/24 8:11
 */
public class SystemRoleMapperProvider {

    public String selectByUser(Long id) {
        return new SQL(){
            {
                SELECT("r.*");
                FROM("system_user u,system_role r,system_user_role ur");
                WHERE("ur.system_user_id=u.id");
                WHERE("ur.system_role_id=r.id");
                WHERE("r.role_status='Y' and ur.status='Y' ");
                WHERE("u.id=#{value}");
            }
        }.toString();
    }

}
